package com.sjd.service;

import com.sjd.dao.BookMapper;
import com.sjd.pojo.Books;

import java.util.List;

public class BookServiceImpl implements BookService{
    //service调dao层:组合dao层
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int modifyBook(Books books) {
        System.out.println("BookServiceImpl:modifyBook===="+books);
        return bookMapper.modifyBook(books);
    }

    @Override
    public Books selectBookById(int id) {
        return bookMapper.selectBookById(id);
    }

    @Override
    public List<Books> selectAllBooks() {
        return bookMapper.selectAllBooks();
    }

    @Override
    public Books selectBook(String bookName) {
        return bookMapper.selectBook(bookName);
    }
}
